Optimal. Leaf size=135 \[ \frac {a^2 (4 B+5 C) \sin (c+d x)}{3 d}+\frac {a^2 (5 B+4 C) \sin (c+d x) \cos ^2(c+d x)}{12 d}+\frac {a^2 (7 B+8 C) \sin (c+d x) \cos (c+d x)}{8 d}+\frac {B \sin (c+d x) \cos ^3(c+d x) \left (a^2 \sec (c+d x)+a^2\right )}{4 d}+\frac {1}{8} a^2 x (7 B+8 C) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.31, antiderivative size = 135, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 7, integrand size = 40, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.175, Rules used = {4072, 4017, 3996, 3787, 2635, 8, 2637} \[ \frac {a^2 (4 B+5 C) \sin (c+d x)}{3 d}+\frac {a^2 (5 B+4 C) \sin (c+d x) \cos ^2(c+d x)}{12 d}+\frac {a^2 (7 B+8 C) \sin (c+d x) \cos (c+d x)}{8 d}+\frac {B \sin (c+d x) \cos ^3(c+d x) \left (a^2 \sec (c+d x)+a^2\right )}{4 d}+\frac {1}{8} a^2 x (7 B+8 C) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2635
Rule 2637
Rule 3787
Rule 3996
Rule 4017
Rule 4072
Rubi steps
\begin {align*} \int \cos ^5(c+d x) (a+a \sec (c+d x))^2 \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx &=\int \cos ^4(c+d x) (a+a \sec (c+d x))^2 (B+C \sec (c+d x)) \, dx\\ &=\frac {B \cos ^3(c+d x) \left (a^2+a^2 \sec (c+d x)\right ) \sin (c+d x)}{4 d}+\frac {1}{4} \int \cos ^3(c+d x) (a+a \sec (c+d x)) (a (5 B+4 C)+2 a (B+2 C) \sec (c+d x)) \, dx\\ &=\frac {a^2 (5 B+4 C) \cos ^2(c+d x) \sin (c+d x)}{12 d}+\frac {B \cos ^3(c+d x) \left (a^2+a^2 \sec (c+d x)\right ) \sin (c+d x)}{4 d}-\frac {1}{12} \int \cos ^2(c+d x) \left (-3 a^2 (7 B+8 C)-4 a^2 (4 B+5 C) \sec (c+d x)\right ) \, dx\\ &=\frac {a^2 (5 B+4 C) \cos ^2(c+d x) \sin (c+d x)}{12 d}+\frac {B \cos ^3(c+d x) \left (a^2+a^2 \sec (c+d x)\right ) \sin (c+d x)}{4 d}+\frac {1}{3} \left (a^2 (4 B+5 C)\right ) \int \cos (c+d x) \, dx+\frac {1}{4} \left (a^2 (7 B+8 C)\right ) \int \cos ^2(c+d x) \, dx\\ &=\frac {a^2 (4 B+5 C) \sin (c+d x)}{3 d}+\frac {a^2 (7 B+8 C) \cos (c+d x) \sin (c+d x)}{8 d}+\frac {a^2 (5 B+4 C) \cos ^2(c+d x) \sin (c+d x)}{12 d}+\frac {B \cos ^3(c+d x) \left (a^2+a^2 \sec (c+d x)\right ) \sin (c+d x)}{4 d}+\frac {1}{8} \left (a^2 (7 B+8 C)\right ) \int 1 \, dx\\ &=\frac {1}{8} a^2 (7 B+8 C) x+\frac {a^2 (4 B+5 C) \sin (c+d x)}{3 d}+\frac {a^2 (7 B+8 C) \cos (c+d x) \sin (c+d x)}{8 d}+\frac {a^2 (5 B+4 C) \cos ^2(c+d x) \sin (c+d x)}{12 d}+\frac {B \cos ^3(c+d x) \left (a^2+a^2 \sec (c+d x)\right ) \sin (c+d x)}{4 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.38, size = 86, normalized size = 0.64 \[ \frac {a^2 (24 (6 B+7 C) \sin (c+d x)+48 (B+C) \sin (2 (c+d x))+16 B \sin (3 (c+d x))+3 B \sin (4 (c+d x))+84 B c+84 B d x+8 C \sin (3 (c+d x))+96 C d x)}{96 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.51, size = 90, normalized size = 0.67 \[ \frac {3 \, {\left (7 \, B + 8 \, C\right )} a^{2} d x + {\left (6 \, B a^{2} \cos \left (d x + c\right )^{3} + 8 \, {\left (2 \, B + C\right )} a^{2} \cos \left (d x + c\right )^{2} + 3 \, {\left (7 \, B + 8 \, C\right )} a^{2} \cos \left (d x + c\right ) + 8 \, {\left (4 \, B + 5 \, C\right )} a^{2}\right )} \sin \left (d x + c\right )}{24 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.64, size = 176, normalized size = 1.30 \[ \frac {3 \, {\left (7 \, B a^{2} + 8 \, C a^{2}\right )} {\left (d x + c\right )} + \frac {2 \, {\left (21 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 24 \, C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 77 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 88 \, C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 83 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 136 \, C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 75 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 72 \, C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{4}}}{24 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 1.67, size = 154, normalized size = 1.14 \[ \frac {B \,a^{2} \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+\frac {a^{2} C \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}+\frac {2 B \,a^{2} \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}+2 a^{2} C \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+B \,a^{2} \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+a^{2} C \sin \left (d x +c \right )}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.38, size = 144, normalized size = 1.07 \[ -\frac {64 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} B a^{2} - 3 \, {\left (12 \, d x + 12 \, c + \sin \left (4 \, d x + 4 \, c\right ) + 8 \, \sin \left (2 \, d x + 2 \, c\right )\right )} B a^{2} - 24 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} B a^{2} + 32 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} C a^{2} - 48 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} C a^{2} - 96 \, C a^{2} \sin \left (d x + c\right )}{96 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 2.95, size = 134, normalized size = 0.99 \[ \frac {7\,B\,a^2\,x}{8}+C\,a^2\,x+\frac {3\,B\,a^2\,\sin \left (c+d\,x\right )}{2\,d}+\frac {7\,C\,a^2\,\sin \left (c+d\,x\right )}{4\,d}+\frac {B\,a^2\,\sin \left (2\,c+2\,d\,x\right )}{2\,d}+\frac {B\,a^2\,\sin \left (3\,c+3\,d\,x\right )}{6\,d}+\frac {B\,a^2\,\sin \left (4\,c+4\,d\,x\right )}{32\,d}+\frac {C\,a^2\,\sin \left (2\,c+2\,d\,x\right )}{2\,d}+\frac {C\,a^2\,\sin \left (3\,c+3\,d\,x\right )}{12\,d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________